Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes that makes CellsToTeX finally loads #624

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mmatera
Copy link
Contributor

@mmatera mmatera commented Nov 15, 2022

One old (small) goal that I had was to fix enough Mathics in order that some relatively non-trivial packages be loaded without failing in basic stuff like storing their definitions.
With this bunch of fixes, I was able to load CellsToTeX` (https://github.com/jkuczm/MathematicaCellsToTeX) and call some of its functions without a crash. Of course, to really make it work I would need to implement several builtins specific for handling WMA notebooks, but I think this is this is a step forward.

I am going to put this as a draft PR and then split back the parts.

#. get_sort_key now has a uniform interface on all the subclasses of KeyComparable, accepting the parameter pattern_sort.
#. circular dependencies in mathics.core.definitions were reduced.
#. to_boxes now returns always a FullForm of the input Expression, instead of raising an exception.
#. Rules of the form pat->Condition[expr, cond] are handled as in WL. The same works for nested Condition expressions. Also, comparisons among these objects were improved.

split mathics.core.attributes
@mmatera mmatera force-pushed the finally_cellstotex_loads_sucessfully branch from 1553778 to c8cbe50 Compare November 16, 2022 13:57
@mmatera mmatera force-pushed the finally_cellstotex_loads_sucessfully branch from 21edeea to b81ccb8 Compare November 16, 2022 15:01
…om or Expression, but have a to_expression method.

* Fix BoxExpression.sameQ to avoid infinite loops.
* adds the pattern_sort parameter to the ``BuiltinExpression.get_sort_key`` method.
@mmatera mmatera force-pushed the finally_cellstotex_loads_sucessfully branch from 3dd9971 to 916d39d Compare November 16, 2022 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant